#! /bin/sh
# this is a comment
if [ $# -ne 3 ]
then
	echo "Error in $0 - Invalid Argument Count"
	echo "Syntax: $0 Linux-Login  LDAP-Login  LDAP-Password"
	exit
fi
cd /home/$1
echo 'Creating folders named achillies and vboxshare in your home folder...'
mkdir /home/$1/achillies
mkdir /home/$1/vboxshare
echo 'installing dkms, portmap, nfs-kernel-server, samba and kdbg...'
apt-get -y install dkms
apt-get -y install portmap nfs-kernel-server
apt-get -y install samba
apt-get -y install kdbg
echo 'Adding support for mounting Achillies into fstab...'
echo "//158.100.142.10/Shared	/home/$1/achillies	cifs	username=$2,password=$3	0	0" >> /etc/fstab
echo 'Adding support for Virtual Box Shared Folder into fstab...'
echo "vboxshare	/home/$1/vboxshare	vboxsf	defaults	0	0" >> /etc/fstab
echo 'Adding Your Home Folder To The Export List For Debug Mounting...'
echo "/home/$1	*(rw,no_squash_root,async)" >> /etc/exports
echo 'Downloading gdb for i686-host/m68k target...'
lftpget http://www.don-and-liz.com/gdb.bin
echo 'Renaming gdb i686-host/i686-target to gdb-pc...'
mv /usr/bin/gdb /usr/bin/gdb-pc
echo 'Installing gdb for i686-host/m68k-target...'
mv gdb.bin /usr/bin
mv /usr/bin/gdb.bin /usr/bin/gdb
echo 'Downloading libstdc++5_3.3.6-17ubuntu1_i386.deb...'
lftpget http://www.don-and-liz.com/libstdc++5_3.3.6-17ubuntu1_i386.bin
mv libstdc++5_3.3.6-17ubuntu1_i386.bin libstdc++5_3.3.6-17ubuntu1_i386.deb
echo 'Installing libstdc++5_3.3.6-17ubuntu1_i386.deb...'
gdebi libstdc++5_3.3.6-17ubuntu1_i386.deb
echo 'Installing g++ for PC Build...'
apt-get -y install g++
echo 'Changing Default Shell from Dash to Bash (for build)...'
rm -f /bin/sh
ln -s /bin/bash /bin/sh
echo 'Installing Eclipse Base...'
apt-get -y install eclipse-cdt
read -p "Eclipse base package installed. Would you like to install Eclipse C/C++ ? (Y|n):" RESPONSE
if [ "$RESPONSE" = "Y" ] ; then7
	echo "Downloading Eclipse C/C++...";
	lftpget http://www.don-and-liz.com/eclipse-cpp-helios-linux-gtk.tar.gz
	echo 'Installing Eclipse C/C++...'
	tar -xzf eclipse-cpp-helios-linux-gtk.tar.gz
	echo 'Creating Desktop Icon for Eclipse C/C++...'
	ln -s /home/$1/eclipse/eclipse /home/$1/Desktop/Eclipse-C-CPP
fi
echo 'Downloading ClearCase Remote Client...'
lftpget http://www.don-and-liz.com/ccrc_linux.zip
echo 'Decompressing ClearCase Remote Client...'
unzip ccrc_linux.zip
echo 'Running ClearCase Remote Client Installation...'
cd /home/$1/ccrc_linux/disk1/setup
./setup.bin
echo 'Creating Desktop Icon for ClearCase Remote Client'
echo 'After Double Clicking the Icon, select "Run in Terminal"'
echo '#!/bin/sh' > /home/$1/Desktop/CC-Remote-Client
echo 'cd /opt/IBM/Rational/ClearCase701/CCRC' >> /home/$1/Desktop/CC-Remote-Client
echo 'sudo ./ccrc -vmargs -Xj9' >> /home/$1/Desktop/CC-Remote-Client
chmod 777 /home/$1/Desktop/CC-Remote-Client
echo 'Done !!'


